package com.kaifamiao.dispatch;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

@WebServlet("/qin")
public class QinServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        this.log( "阿琴" );
        // String url = "http://www.kaifamiao.com";
        String msg = "芳，帮我打你面前这个人一顿";
        String url = "/fang?letter=" + URLEncoder.encode(msg, StandardCharsets.UTF_8);
        response.sendRedirect( url );
        return;
    }

}
